body {
    font-family: 'Arial', sans-serif;
    margin: 20px;
    background: #f0f2f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

button, select {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

#sudoku-board {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative; /* 为遮罩层定位做准备 */
}

.sudoku-grid {
    border-collapse: collapse;
    margin: 0 auto;
}

.sudoku-cell {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 1.4em;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
    background: white;
}

.sudoku-cell:focus {
    outline: 3px solid rgba(0,123,255,0.3);
    z-index: 2;
}

/* 新增正确状态样式 */
.sudoku-cell.correct {
    background-color: #d4edda !important;
    border-color: #c3e6cb;
}

/* 修改错误状态样式 */
.sudoku-cell.error {
    background-color: #f8d7da !important;
    border-color: #f5c6cb;
}

.thick-right {
    border-right: 2px solid #495057 !important;
}

.thick-bottom {
    border-bottom: 2px solid #495057 !important;
}

.sudoku-cell.highlight {
    background: #fff3cd !important;
}

.sudoku-cell.current {
    background: #ffeeba !important;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

#status {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

@media (max-width: 600px) {
    .sudoku-cell {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
}

#timer {
    margin-left: auto;
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    padding: 6px 12px;
    background: #e9ecef;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

/* 暂停状态样式 */
#sudoku-board.paused {
    position: relative;
    filter: grayscale(0.6);
    transition: filter 0.3s ease;
}

#sudoku-board.paused .sudoku-cell {
    color: rgba(0, 0, 0, 0.4) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#sudoku-board.paused .sudoku-cell.initial,
#sudoku-board.paused .sudoku-cell:not(.initial) {
    background-color: #f8f9fa !important;
    opacity: 0.9;
}

#pauseBtn.paused {
    background-color: #28a745;
}

#pauseBtn.paused::after {
    content: "继续";
}

#pauseBtn:not(.paused)::after {
    content: "暂停";
}

/* 禁用状态样式 */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 添加暂停遮罩层 */
.paused-overlay {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.5em;
    color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

#sudoku-board.paused .paused-overlay {
    display: flex;
}

@media (max-width: 600px) {
    #sudoku-board.paused {
        filter: grayscale(0.8) blur(1px);
    }
    .paused-overlay {
        font-size: 1.4em;
        padding: 15px 30px;
    }
}